<template >
  <div class="flex auto" style="padding:20px">
    <span v-show='!usertypestate'>
      <input type="checkbox" v-model="userinfo.identitycard" :false-value='0' :true-value='1' class="magic-checkbox" id="identitycard">
      <label for="identitycard">安检人员入户着全套工作服及佩戴工作牌
      <span v-if='userinfo.identitycard'>**是</span><span v-else>**否</span> </label>
    </span>
    <span v-show='!usertypestate'>
      <input type="checkbox" v-model="userinfo.result" :false-value='0' :true-value='1'class="magic-checkbox" id="result">
      <label for="result">安检人员向用户解释检查结果
    <span v-if='userinfo.result'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='!usertypestate'>
      <input type="checkbox" v-model="userinfo.attitude" :false-value='0' :true-value='1' class="magic-checkbox" id="attitude">
      <label for="attitude">安检人员服务态度
      <span v-if='userinfo.attitude'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='!usertypestate'>
       <input type="checkbox" v-model="userinfo.quality" :false-value='0' :true-value='1' class="magic-checkbox" id="quality">
      <label for="quality"> 安检人员工作内容及质量
       <span v-if='userinfo.quality'>**是</span><span v-else>**否</span></label>
    </span>
<span v-show='usertypestate' >****隐患类别****</span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.diepullrandomaccess" :false-value='0' :true-value='1' class="magic-checkbox" id="diepullrandomaccess">
       <label for="diepullrandomaccess">死拉乱接
      <span v-if='userinfo.diepullrandomaccess'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.livekitchen" :false-value='0' :true-value='1' class="magic-checkbox" id="livekitchen">
       <label for="livekitchen">厨房住人
      <span v-if='userinfo.livekitchen'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.nopartition" :false-value='0' :true-value='1' class="magic-checkbox" id="nopartition">
       <label for="nopartition">厨房无隔断
      <span v-if='userinfo.nopartition'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.hosetoolong" :false-value='0' :true-value='1' class="magic-checkbox" id="hosetoolong">
       <label for="hosetoolong">软管过长
      <span v-if='userinfo.hosetoolong'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.gmeterpackage" :false-value='0' :true-value='1' class="magic-checkbox" id="gmeterpackage">
       <label for="gmeterpackage">气表包裹
      <span v-if='userinfo.gmeterpackage'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.ventilation" :false-value='0' :true-value='1' class="magic-checkbox" id="ventilation">
       <label for="ventilation">通风不良
      <span v-if='userinfo.ventilation'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.connectthree" :false-value='0' :true-value='1' class="magic-checkbox" id="connectthree">
       <label for="connectthree">私接三通
      <span v-if='userinfo.connectthree'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.twofire" :false-value='0' :true-value='1' class="magic-checkbox" id="twofire">
       <label for="twofire">两种火源
      <span v-if='userinfo.twofire'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.gasappliance" :false-value='0' :true-value='1' class="magic-checkbox" id="gasappliance">
       <label for="gasappliance">燃气设备安装在浴室，卫生间
      <span v-if='userinfo.gasappliance'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.changeproperties" :false-value='0' :true-value='1' class="magic-checkbox" id="changeproperties">
       <label for="changeproperties">改变用气性质
      <span v-if='userinfo.changeproperties'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.otherrisks " :false-value='0' :true-value='1' class="magic-checkbox" id="otherrisks">
       <label for="otherrisks">其他隐患
      <span v-if='userinfo.otherrisks'>**是</span><span v-else>**否</span></label>
    </span>
<span v-show='usertypestate'>****建议处理措施****</span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.immediaterectification" :false-value='0' :true-value='1' class="magic-checkbox" id="immediaterectification">
       <label for="immediaterectification">用户立即整改
      <span v-if='userinfo.immediaterectification'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.companyrectification" :false-value='0' :true-value='1' class="magic-checkbox" id="companyrectification">
       <label for="companyrectification">联系燃气设备公司进行整改
      <span v-if='userinfo.companyrectification'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.gasrectification" :false-value='0' :true-value='1' class="magic-checkbox" id="gasrectification">
       <label for="gasrectification">报燃气公司整改
      <span v-if='userinfo.gasrectification'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="userinfo.selfrectification" :false-value='0' :true-value='1' class="magic-checkbox" id="selfrectification">
       <label for="selfrectification">用户自行整改
      <span v-if='userinfo.selfrectification'>**是</span><span v-else>**否</span></label>
    </span>
    <span>****其他说明****</span>
    <span >
      <input type="checkbox" v-model="userinfo.Normalfacilities" :false-value='0' :true-value='1' class="magic-checkbox" id="Normalfacilities">
      <label for="Normalfacilities">经检查，贵户燃气设施一切正常，用户确认
      <span v-if='userinfo.Normalfacilities'>**是</span><span v-else>**否</span></label>
    </span>
    <span >
      <input type="checkbox" v-model="userinfo.trouble" :false-value='0' :true-value='1' class="magic-checkbox" id="trouble">
      <label for="trouble">故障暂时不能排查，已关闭阀门，请用户拨打维修热线电话进行报修
      <span v-if='userinfo.trouble'>**是</span><span v-else>**否</span></label>
    </span>
    <span >
      <input type="checkbox" v-model="userinfo.replace" :false-value='0' :true-value='1' class="magic-checkbox" id="replace">
       <label for="replace">贵户灶具，热水器，壁挂炉，已过使用期限，但暂不更换
      <span v-if='userinfo.replace'>**是</span><span v-else>**否</span></label>
    </span>
  </div>
</template>

<script>
export default {
  props: ['user'],
  title:'用户相关',
  data() {
    return {
      usertypestate: false,
      userinfo:{
        identitycard: 0,
        result: 0,
        attitude: 0,
        quality: 0,
        Normalfacilities: 0,
        trouble: 0,
        replace: 0
      }
    }
  },
  watch: {
  user:{
      handler:function (val,oldVal) {
          this.model = Object.assign({}, this.model, this.user)
          if (val.f_usertype === '非民用') {
            console.log('非民用');
            this.usertypestate = false
          } else {
            console.log('民用');
            this.usertypestate =true
          }
      },
      deep:true
  }
},
ready() {
  this.model = Object.assign({}, this.model, this.user)
  if (this.model.f_usertype === '非民用') {
    console.log('非民用');
    this.usertypestate = false
  } else {
    console.log('民用');
    this.usertypestate =true
  }
}
}
</script>

<style lang="css">
</style>
